package com.daftmaster.controller;

import com.daftmaster.service.DeptService;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 组织机构操作控制层
 *
 * @author Daft_V
 * @date 2022/3/24 10:38
 */
@Controller
@RequestMapping("/dept")
public class DeptController {

    @Autowired
    DeptService deptService;

    @GetMapping("/deptQueryTree")
    @ResponseBody
    public JSONObject deptQueryTree(){
        JSONObject jsonObject=JSONObject.fromObject(deptService.queryDeptTree(1,"0"));
        return jsonObject;
    }
}
